PBDTGetIconSync
DTPBPtr paramBlock ; pointer to a DTPB Param Block
Boolean async; 0 = await completion; 1 = immediate return Parameter block
ۮ 12 ioCompletion long completion routine
۬ 16 ioResult short result code
ۮ 24 ioDTRefNum short database reference number
۬ 28 ioTagInfo long reserved; must be initialized to 0
ۮ 32 ioDTBuffer long pointer to icon data
ۮ 36 ioDTReqCount long requested size of icon bitmap
۬ 40 ioDTActCount long actual size of icon bitmap
ۮ 45 ioIconType char icon type
ۮ 52 ioFileCreator long icon's file creator
ۮ 56 ioFileType long icon's file type
PBDTGetIcon returns the bitmap for an icon that represents a file of a given type and creator. You pass a pointer to the buffer for the icon bitmap in the
ioDTBuffer field. The bitmap is returned in the buffer pointed to by
ioDTBuffer. You specify the desktop database in ioDTRefNum, the file creator
in ioFileCreator, and the file type in ioFileType. For the icon type in
ioIconType, specify a constant from the following list.
Corresponding
Constant Value resource type Description
kLargeIcon 1 'ICN#' Large black-and-white icon with mask
kLarge4BitIcon 2 'icl4' Large 4-bit color icon
kLarge8BitIcon 3 'icl8' Large 8-bit color icon
kSmallIcon 4 'ics#' Small black-and-white icon with mask
kSmall4BitIcon 5 'ics4' Small 4-bit color icon
kSmall8BitIcon 6 'ics8' Small 8-bit color icon
The value you supply in ioDTReqCount is the size in bytes of the buffer that
you've allocated for the icon's bitmap pointed to by ioDTBuffer; this value
depends on the icon type. Be sure to allocate enough storage for the icon data;
1024 bytes is the largest amount required for any icon under System 7.0. You
can use a constant from the following list.
bytes in Corresponding
Constant bitmap) resource type Description
kLargeIconSize 256 'ICN#' Large black-and-white
icon with mask
kLarge4BitIconSize 512 'icl4' Large 4-bit color icon
kLarge8BitIconSize 1024 'icl8' Large 8-bit color icon
kSmallIconSize 64 'ics#' Small black-and-white
icon with mask
kSmall4BitIconSize 128 'ics4' Small 4-bit color icon
kSmall8BitIconSize 256 'ics8' Small 8-bit color icon
The value in ioDTActCount reflects the size of the bitmap actually retrieved. If
ioDTActCount is larger than ioDTReqCount, only the amount of data allowed by
Returns: an Error code. It will be one of the following:
noErr (0) No error
ioErr (-36) I/O error
rfNumErr (-51) Reference number invalid
extFSErr (-58) External file system-file system identifier is nonzero
afpItemNotFound (-5012) Information not found
Note: There is a second, asynchronous, version of this function. It does not take a
second parameter; instead, it adds the suffix "Async" to the name of the
routine.
Similarly, the third (synchronous) version of the routine does not take a
second parameter; instead, it adds the suffix "Sync" to the name of the
routine.
Note, however, that the second and third versions of these routines do not
use the glue code that the first versions use and are therefore more
efficient.